﻿using AutoMapper;
using ControlCenter.Model;

namespace ControlCenter.Operation
{
    /// <summary>
    /// AutoMapper关系配置类
    /// </summary>
    public class OperationAutoMapperProfile : Profile
    {
        public OperationAutoMapperProfile()
        {

            CreateMap<ExecutionCallbackDto, ExecutionQueue>();

        }
    }

    public static class AutoMapExtensions
    {
        public static TDestination MapTo<TDestination>(this object source)
        {
            return Mapper.Map<TDestination>(source);
        }

        public static TDestination MapTo<TSource, TDestination>(this TSource source, TDestination destination)
        {
            return Mapper.Map(source, destination);
        }
    }
}
